(function() {
	var skill = {
		save: function() {
			delete this._current_employee;
			db.update(config.dbname.bus, this._id, this);
		},
		destroy: function() {
			//Domain记录
			(this.info.domainIdList || []).forEach(function(domain_id) {
				var domain = DomainCon.get(domain_id);
				if (domain) {
					domain.destroy();
				}
			});
			// //商品
			// (this.info.store||[]).forEach(function (goods_id) {
			// 	var goods = GoodsCon.get(goods_id);
			// 	if (goods) {
			// 		goods.destroy();
			// 	}
			// });

			db.remove(config.dbname.bus, this._id);
		},
		getName: function() {
			return this.info.title;
		},
		/*
		 * 设置配置
		 */
		setInfo: function(info) {
			var _cache_instance;
			info.name = info.name ? info.name.trim() : "";
			info.title = info.title ? info.title.trim() : "";
			info.address = info.address ? info.address.trim() : "";
			info.address_info = info.address_info || {};
			info.email = info.email ? info.email.trim() : "";
			info.mobile_phone = info.mobile_phone ? info.mobile_phone.trim() : "";
			info.intro = info.intro ? info.intro.trim() : "";
			info.store_imgs = info.store_imgs instanceof Array ? info.store_imgs : [];
			info.logo_url = info.logo_url ? info.logo_url.trim() : "";
			info.logistics = info.logistics ? info.logistics.trim() : "";
			info.open_time = info.open_time || {};
			info.qq = info.qq || "";
			info.alipay = info.alipay || {};
			info.tenpay = info.tenpay || {};
			info.wx_config = info.wx_config || {};
			info.version = info.version || "std";
			info.way = info.way || "";
			info.data_get_cash_times_each_month = parseFloat(info.data_get_cash_times_each_month) || 0;
			info.data_get_cash_max_each_time = parseFloat(info.data_get_cash_max_each_time) || 0;
			info.data_to_forever_bina_cash = parseFloat(info.data_to_forever_bina_cash) || 0;

			//商家名
			var bus_name = info.name || info._id;
			if (this.info.name !== bus_name) {
				if (!helper.name(bus_name, "商家名")) {
					throwCusError("商家名不符合规范")
				}
				if ((_cache_instance = db.find_one(config.dbname.bus, {
						info: {
							name: bus_name
						}
					})) && _cache_instance._id !== this._id) {
					throwCusError("商家名已被使用")
				}
				this.info.name = bus_name;
			}
			//店铺名称
			var bus_title = info.title || info.name;
			if (!bus_title) {
				throwCusError("店铺名称不可为空")
			}
			if (!helper.folder_name(bus_title)) {
				throwCusError("店铺名称不符合规范")
			}
			this.info.title = bus_title;
			//地址
			// this.info.address = info.address;
			//地址详情
			var address_info = info.address_info;
			address_info = this.info.address_info = {
				province: address_info.province || "",
				town: address_info.town || "",
				county: address_info.county || "",
				detail: address_info.detail || "",
			};
			this.info.address_info = address_info;
			this.info.address = address_info.province + address_info.town + address_info.county + address_info.detail;
			//绑定的邮箱
			if (this.info.email !== info.email) {
				if (!helper.isEmail(info.email)) {
					throwCusError("邮箱格式不正确")
				}
				if ((_cache_instance = db.find_one(config.dbname.bus, {
						info: {
							email: info.email
						}
					})) && _cache_instance._id !== this._id) {
					// console.log("email:",_cache_instance._id);
					throwCusError("邮箱已被使用")
				}
				this.info.email = info.email;
			}
			//绑定的手机
			if (!this.info.mobile_phone) { //如果手机号码是空，可以进行初始化
				this.setMobilePhone(info.mobile_phone);
			}
			//介绍
			this.info.intro = info.intro;
			// 门面图片
			this.info.store_imgs = info.store_imgs.filter(function(store_img) {
				return store_img && store_img.href;
			});
			if (this.info.store_imgs.length > config.storeImagesNumber) {
				this.info.store_imgs.length = config.storeImagesNumber - 1;
			}
			//LOGO
			this.info.logo_url = info.logo_url;

			if (info.logistics && !helper.folder_name(info.logistics)) {
				throwCusError("合作物流有误")
			}
			this.info.logistics = info.logistics;
			//营业时间
			var open_time = this.info.open_time = {};
			open_time.s_hour = ~~info.open_time.s_hour || 8;
			open_time.s_min = ~~info.open_time.s_min || 0;
			open_time.e_hour = ~~info.open_time.e_hour || 23;
			open_time.e_min = ~~info.open_time.e_min || 0;
			//QQ
			this.info.qq = info.qq;
			this.info.alipay = {
				partner: info.alipay.partner,
				key: info.alipay.key,
				seller_email: info.alipay.seller_email,
			};
			this.info.tenpay = {
				appid: info.tenpay.appid,
				key: info.tenpay.key,
			};
			this.info.wx_config = {
				appId: info.wx_config.appId,
				appSecret: info.wx_config.appSecret,
				mchId: info.wx_config.mchId,
				Key: info.wx_config.Key,
			};
			//版本号
			this._setVersion(info.version);
			//简单的去程方式
			this.info.way = info.way;
			//LBS的poi
			this.setLBS(info.lat, info.lon);

			//运费减免配置
			this.info.express_free_total_price = parseFloat(info.express_free_total_price) || 0;
			this.info.express_free_total_num = parseFloat(info.express_free_total_num) || 0;

			//提现限制配置
			this.info.data_get_cash_max_each_time = info.data_get_cash_max_each_time; //单词提现上限
			this.info.data_get_cash_times_each_month = info.data_get_cash_times_each_month; //月限提现次数
			//分销相关配置
			this.info.data_to_forever_bina_cash = info.data_to_forever_bina_cash; //分销商品累积购买加入永久分销

			this.save();
		},
		_setLBS: function(lat, lon) {
			lat = parseFloat(lat) || 0;
			lon = parseFloat(lon) || 0;
			if (lat || lon) {
				if (!this.info.lbs_id) {
					this.info.lbs_id = LBS.create({
						title: this.info.title,
						address: this.info.address,
						lat: lat,
						lon: lon,
						logo_url: this.info.logo_url,
						mobile_phone: this.info.mobile_phone
					});
				} else {
					LBS.update(this.info.lbs_id, {
						title: this.info.title,
						address: this.info.address,
						lat: lat,
						lon: lon,
						logo_url: this.info.logo_url,
						mobile_phone: this.info.mobile_phone
					});
				}
				this.info.lbs_info = {
					lat: lat,
					lng: lon,
				};
				this.save();
			}
		},
		setLBS: function(lat, lon) {
			try {
				this._setLBS(lat, lon);
			} catch (e) {
				//出错了，可能是节点被删除的问题
				if (this.info.lbs_id) {
					var poi = LBS.get(this.info.lbs_id);
					if (!poi) { //poi不存在，真的是节点问题
						this.info.lbs_id = null; //删除这个节点，重新运行
						this._setLBS(lat, lon);
						return;
					}
					//否则就让错误抛出
				}
				throw e;
			}
		},
		//手机号码是和商家绑定的，需要用其它方式进行修改，不放在setInfo里面
		setMobilePhone: function(mobile_phone) {
			if (this.info.mobile_phone !== mobile_phone) {
				if (!helper.phone(mobile_phone)) {
					throwCusError("手机号码格式不正确");
				}
				if ((_cache_instance = db.find_one(config.dbname.bus, {
						info: {
							mobile_phone: mobile_phone
						}
					})) && _cache_instance._id !== this._id) {
					throwCusError("手机号码已被使用")
				}
				this.info.mobile_phone = mobile_phone;
			}
			this.save();
		},
		/*
		 * 设置商家使用的版本号
		 */
		_setVersion: function(version_str) {
			var result = this.info.version = version_str || "std";
			this.save();
			return result;
		},
		getVersion: function() {
			return this.info.version || this._setVersion();
		},
		/*
		 * 商家只拥有初始化一次域名的权限，修改只能在管理员提供权限，或者通过相关的商业模式来购买修改权限
		 */
		initDomain: function(domain, is_secondary_domain) {
			var domainIdList = this.info.domainIdList;
			/* || db.find_one(config.dbname.domain, {
				bus_id: this._id
			});*/

			if (domainIdList && domainIdList instanceof Array && domainIdList.length) {
				console.error("商家已经绑定域名:", domainIdList);
				throwCusError("商家已经绑定域名")
			} else {
				domainIdList = [];
			}
			var domainInfo = new DomainCon({
				domain: domain,
				is_secondary_domain: is_secondary_domain,
				bus_id: this._id
			});

			domainIdList.push(domainInfo._id);
			this.info.domainIdList = domainIdList;
			this.save();

			midEvent.emit("bus.new", this._id);

			//返回格式化过的数据
			return domain;
		},
		getDomainUrl: function() {
			var domainIdList = $Array.clearNull(this.info.domainIdList || []);
			if (!domainIdList.length) {
				var domainInfoList = DomainCon.findByBusId(this._id);
				if (domainInfoList.length) {
					//进行缓存
					domainIdList = domainInfoList.map(function(domainInfo) {
						return domainInfo._id;
					});
					this.info.domainIdList = domainIdList;
					this.save();
				}
			} else {
				domainInfoList = domainIdList.map(function(domain_id) {
					return DomainCon.get(domain_id);
				});
				var new_domainInfoList = $Array.clearNull(domainInfoList);
				if (new_domainInfoList.length != domainInfoList.length) { //数据不想对，清空缓存，重新获取
					this.info.domainIdList = [];
					return this.getDomainUrl();
				}
			}
			if (domainInfoList && domainIdList.length) {
				return domainInfoList;
			} else {
				//没有绑定域名，返回空数组
				return [];
			}
		},
		//不安全，目前只给管理员提供这个接口，修改二级域名
		_updateSecondaryDomain: function(domain) {
			var domainIdList = this.info.domainIdList;
			var has_second_domain = false;
			domainIdList.forEach(function(domain_id) {
				var domainInfo = DomainCon.get(domain_id);
				if (domainInfo.is_secondary_domain) {
					domainInfo._updateSecondaryDomain(domain);
					has_second_domain = true;
				}
			});
			if (!has_second_domain) {
				throwCusError("指定商家并无绑定二级域名")
			}
		},
		getOneVisitableUrl: function() {
			var result = "";
			this.getDomainUrl().forEach(function(domainInfo) {
				if (!result || result.port != 80) {
					result = domainInfo
				}
			});
			return result && result.getUrl();
		},
		checkOrigin: function(origin) {
			var result = false;
			if (origin === "chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop") {
				return true;
			}
			this.getDomainUrl().forEach(function(domainInfo) {
				if (domainInfo.getUrl().indexOf(origin) !== -1) {
					result = true;
				}
			});
			return result;
		},
		/*
		 * 改动商家密码
		 */
		setPassword: function(old_pwd, new_pwd) {
			console.log(old_pwd, new_pwd);
			if (this.info.password !== md5.md5_2(old_pwd)) {
				throwCusError("密码不正确，无权进行修改");
			}
			this._setPassword(new_pwd);
		},
		//非安全，强制改密码
		_setPassword: function(new_pwd) {
			this.info.password = md5.md5_2(new_pwd);
			this.save();
		},
		/*
		 * 配置信息
		 */
		setConfig: function(key, data) {
			var config = this.config || (this.config = {});
			config[key] = data;
			this.checkConfig();
			this.save();
		},
		setMixConfig: function(keys, mix_data) {
			var config = this.config || (this.config = {});
			mix_data || (mix_data = {});
			keys.forEach(function(key) {
				config[key] = mix_data[key];
			});
			this.checkConfig();
			this.save();
		},
		/*
		 * 权限信息
		 */
		getPerm: function() {
			return this.permission || {}
		},
		setPerm: function(key, value) {
			var self = this;
			var permission = this.permission || (this.permission = {});
			var old_value = permission[key];
			switch (key) {
				//Boolean
				case "can_set_goods_call_back_buff":
				case "can_sale_virtual_goods":
				case "can_only_online_pay":
				case "can_invite_bus":
				case "can_set_theme":
				case "can_goods_be_bina":
				case "can_bina_to_third":
				case "bina_no_need_buy":
				case "can_multi_bina":
				case "can_use_lottery":
				case "can_municipal_agency": // 市代
				case "can_purchase": //采购
					permission[key] = helper.boolean_parse(value);
					break;
					//字符串
				case "data_mobile_theme_name":
				case "data_bina_buff_id":
				case "data_guide_bina_buff_id":
				case "data_management_category":
				case "data_pc_template_name":
				case "data_mobile_template_name":
					permission[key] = String(value || "");
					break;
					//数组
				case "data_goods_bina_list":
				case "data_forever_bina_user_list":
				case "data_senior_bina_user_list":
					permission[key] = Array.prototype.slice.call(value); //强制转化为数组
					break;
					//整数
				case "data_goods_bina_num":
				case "data_max_goods_num":
					permission[key] = parseInt(value) || 0; //强制转化为数组
					break;
					//浮点数
					// case "data_get_cash_times_each_month":
					// case "data_get_cash_max_each_time":
					// 	permission[key] = parseFloat(value) || 0; //强制转化为数组
					// 	break;
				default:
					throwCusError("无效的权限设置项");
					return
			}

			//权限特殊关联
			if (!permission.can_goods_be_bina) { //二级分销不开启的话，三级分销也会被关闭
				permission.can_bina_to_third = false;
			}
			//分销商品一旦添加，永久分销人员就要马上享有这个商品的分销权
			if (key === "data_goods_bina_list" && Array.isArray(old_value) && Array.isArray(permission.data_forever_bina_user_list)) {
				var old_value_map = $Array.toMap(old_value);
				var new_value_map = $Array.toMap(permission[key]);
				for (var bina_id in new_value_map) {
					if (!old_value_map[bina_id]) { //如果是旧表中没有，说明这个商品可能是新的分销商品，马上把分销权限提供给所有永久分销人员
						permission.data_forever_bina_user_list.forEach(function(user_id) {
							self.addUserToBina(bina_id, user_id, null, "silence")
						});
					}
				}
			}

			this.save();
			//返回格式化完成的数据
			return permission[key];
		},
		/*
		 * 格式化配置
		 */
		checkConfig: function() {
			var myConfig = this.config;
			//商家首页轮播
			if (myConfig.home_imgs && myConfig.home_imgs.length > config.slideNumber) {
				myConfig.home_imgs.length = config.slideNumber;
			}
			//是否开启背景模糊
			myConfig.is_bg_img_blur = helper.boolean_parse(myConfig.is_bg_img_blur);
			//是否使用背景图
			myConfig.is_use_bg_img = helper.boolean_parse(myConfig.is_use_bg_img);
			//是否开启背景半透明
			myConfig.is_bg_img_alpha = helper.boolean_parse(myConfig.is_bg_img_alpha);
			//商家公告栏
			if (myConfig.notices && myConfig.notices.length) {
				myConfig.notices = myConfig.notices.map(function(notice) {
					return {
						content: notice.content,
						url: helper.isUrl(notice.url) ? notice.url : ""
					}
				});
			}
			//是否关闭邮箱提醒
			myConfig.is_close_email_notify = helper.boolean_parse(myConfig.is_close_email_notify);
			//关联商家
			if (myConfig.assshop instanceof Array) {
				myConfig.assshop = $Array.clearNull(myConfig.assshop.map(function(bus_info) {
					if (bus_info.bus_id && BusCon.get(bus_info.bus_id)) {
						return {
							bus_id: bus_info.bus_id
						}
					}
				}));
			} else {
				myConfig.assshop = [];
			}
			this.save();
		},
		//获取所有商品的评价
		getEvaluations: function(num, page) {
			var goods = this.getGoodsList();
			var evaluations = [];
			goods.forEach(function(goods_item) {
				evaluations = evaluations.concat(goods_item.getEvaluations());
			});
			evaluations = data_cut.page(evaluations, num, page);
			return evaluations;
		},
		//带着页面信息的评价信息
		getEvaluations_PageInfo: function(num, page) {
			var result = this.getEvaluations();
			return {
				total_num: result.length,
				total_page: Math.round(result.length / num) || 1, //至少一页
				evaluations: data_cut.page(result, num, page),
				page: +page || 0,
				num: +num || 0
			}
		},
		//添加评论==评论、回复评价
		addComment: function(reply_id, content, isAny) {
			var comment = new CommentCon({
				type: "bus",
				commenter_id: this._id,
				content: content,
				isAny: isAny,
				reply_id: reply_id
			});
			return comment._id;
		},
		//添加评论，非安全
		_addComment: function(comment_id) {
			var comments = this.comments || (this.comments = []);
			comments.unshift(comment_id);
			this.save();
		},
		//收到评论的回复
		_addReply: function(comment_id) {
			console.log("收到评论回复：", comment_id);
			var replys = this.replys || (this.replys = []);
			replys.unshift(comment_id);
			this.save();
		},
		//移除收到的回复
		_removeReply: function(comment_id) {
			var replys = this.replys || (this.replys = []);
			var index = replys.indexOf(comment_id);
			if (index) {
				replys.splice(index, 1);
				this.save();
			} else {
				throwCusError("回复不属于指定的对象");
			}
		},
		getReplys: function(num, page) {
			var replys = this.replys || (this.replys = []);
			replys = data_cut.page(replys, num, page);
			replys.forEach(function(comment_id, index) {
				var comments = CommentCon.get(comment_id);
				replys[index] = comments.getDetail();
			});
			return replys;
		},
		updateGoodsTags: function(goods_id, tags) {
			var self = this;
			var goods = this._getGoods(goods_id);

			var tagsMap = {};
			goods.tags.forEach(function(tag_id) {
				tagsMap[tag_id] = -1;
			});
			tags.forEach(function(tag_id) {
				//要删除的就是-1，保留的就是0，新增的就是1
				tagsMap[tag_id] = ~~tagsMap[tag_id] + 1;
			});
			Object.keys(tagsMap).forEach(function(tag_id) {
				if (tagsMap[tag_id] === 1) {
					self.addGoodsToTag(tag_id, goods_id);
				} else if (tagsMap[tag_id] === -1) {
					self.removeGoodsFromTag(tag_id, goods_id);
				}
			});

		},
		//设置商品的推荐积分
		setRecommendGoodsInt: function(goods_name, intValue) {
			var rg_info = db.find_one({
				goods_name: goods_name
			});
			if (!rg_info) {
				rg_info = {
					_id: "RGI_" + (+new Date).toString(16),
					goods_name: goods_name,
					intValue: intValue
				}
			}
			console.log("设置商品“", goods_name, "”的推荐积分为：", intValue);
		},
		//获取商品的推荐积分
		getRecommendGoodsInt: function(goods_name) {
			var rg_info = db.find_one(config.dbname.RecommendGoodsInt, {
				goods_name: goods_name
			});
			return rg_info ? rg_info.intValue : 0;
		},
		//为用户添加“推荐积分”
		//这里另外写一个方法进行封装是为了记录操作日志，确保积分的来源可寻
		_IncRecIntToUser: function(user_id, intValue) {
			var user = UserCon.get(user_id);
			user._recInt(intValue);
		},
		//申请加入联盟，实现是同个通讯平台去沟通，而后再由管理员拉取商家进入
		// joinLeague:function(league_id){},
		//获取当前所在联盟
		getLeague: function() {
			var league_id = this.league;
			league = LeagueCon.get(league_id);
			if (!league) {
				throwCusError("商家未加入任何联盟")
			}
			return league;
		},
		//非安全，加入联盟
		_setLeague: function(league_id) {
			this.league = league_id;
			this.save();
		},
		//离开当前所在联盟
		leaveLeague: function() {
			var league = this.getLeague();
			league._removeMerchant(this._id);
		},
		getAccUsers: function(num, page) {
			var acc_infos = BusUserBindCon.findByBusId(this._id);
			acc_infos = data_cut.page(acc_infos, num, page);
			acc_infos = acc_infos.map(function(bus_user_bind) {
				bus_user_bind = $Object.clone(bus_user_bind);
				bus_user_bind.user = UserCon.get(bus_user_bind.user_id);
				bus_user_bind.bus = BusCon.get(bus_user_bind.bus_id);
				return bus_user_bind;
			});
			return acc_infos;
		},
		// //代码片段，根据id获取Buff
		// _getGoods:function(goods_id){
		// 	var store = this.store||(this.store = []);
		// 	var index = store.indexOf(goods_id);
		// 	if (index===-1) {
		// 		throwCusError("商品不属于指定商家")
		// 	}
		// 	var goods = GoodsCon.get(goods_id);
		// 	if (!goods) {
		// 		throwCusError("找不到指定商品")
		// 	}
		// 	return goods;
		// },

		//代码片段，添加BUFF
		_addBuff: function(buff_id) {
			var buffs = this.buffs || (this.buffs = []);
			buffs.push(buff_id);
			this.save();
		},
		getBuffs: function() {
			var buffs = this.buffs || (this.buffs = []);
			var _new_buffs = [];
			var result = [];
			buffs.forEach(function(buff_id) {
				var buff = BuffCon.get(buff_id);
				if (buff && buff.isUseAble()) {
					//保留有用的BUFF
					_new_buffs.push(buff_id);

					result.push(buff);
				}
			});
			//如果存在无效的BUFF，直接移除
			if (_new_buffs.length !== buffs.length) {
				this.buffs = _new_buffs;
				this.save();
			}
			//加入特殊BUFF
			//推荐返利有相关的配置的话
			if (this.recommend_config && this.recommend_config.length) {
				result.push(this.getRecommendConfigBuff());
			}

			//获取商家的全局BUFF，如果商家在联盟中，还应继承联盟所给的BUFF
			var league_id = this.league;
			if (league_id && (league = LeagueCon.get(league_id))) {
				result = result.concat(league.getBuffs());
			}
			return result;
		},
		//创建商家的BUFF
		createBuff: function(buffInfo) {
			var buff = new BuffCon(buffInfo);
			this._addBuff(buff._id);
			return buff._id;
		},
		//为商品添加BUFF
		addBuffForGoods: function(goods_id, buffInfo) {
			var goods = this._getGoods(goods_id);
			var buff_id = this.createBuff(buffInfo);
			goods._addBuff(buff_id);
		},
		/*推荐返利*/
		getRecommendConfig: function() {
			var recommend_config = this.recommend_config || [];
			var _need_save = false;
			recommend_config.forEach(function(config) {
				if (!config.hasOwnProperty("disc_rate")) {
					_need_save = true;
					config.disc_rate = config.rate
				}
			});
			_need_save && (this.recommend_config = recommend_config) && this.save();
			return recommend_config;
		},
		//获取推荐折扣比例
		getRecommendDiscount: function() {
			return this.recommend_discount || 0;
		},
		updateRecommendDiscount: function(discount_value) {
			discount_value = parseFloat(discount_value);
			discount_value || (discount_value = 0);
			if (discount_value < 0 || discount_value > 1) {
				throwCusError("错误的推荐折扣比例")
			}
			this.recommend_discount = discount_value;
			this.save();
		},
		//取消折扣
		disableRecommendDiscount: function() {
			this.updateRecommendDiscount(0);
		},
		updateRecommendConfig: function(new_recommend_config) {
			if (!(new_recommend_config instanceof Array)) {
				new_recommend_config = [];
			}
			this.recommend_config = new_recommend_config.map(function(config) {
				config.max_price = parseFloat(config.max_price) || 0;
				config.rate = parseFloat(config.rate) || 0;
				config.disc_rate = parseFloat(config.disc_rate) || 0;
				return config;
			}).sort(function(a, b) {
				return a.max_price > b.max_price
			});
			this.save();
		},
		getRecommendConfigBuff: function() {
			var self = this;
			var buff_id = self.recommend_config_buff_id;
			if (typeof buff_id !== "string") {
				buff_id = self.recommend_config_buff_id = new BuffCon({
					name: "推荐有赏",
					code_id: "推荐返利",
					config: {
						bus_id: self._id
					}
				})._id;
				this.save();
			}
			// console.log("recommend_config_buff_id:", buff_id);
			return BuffCon.get(buff_id);
		},
		//商家作为一个用户来进行登录
		asUser: function() {
			var user_id = this.user_id;
			if (!user_id) {
				var name = this.info.name;
				var i = 0;
				do {
					var mybey_user = db.find_one(config.dbname.user, {
						info: {
							name: name
						}
					});
					if (mybey_user) {
						name = this.info.name + i;
						i += 1;
					}
				} while (mybey_user)
				var as_user = new UserCon({
					name: name,
					//使用的是加密过的密码，意味着这个用户的密码没有人知道，无法主动登录
					password: this.info.password,
					mobile_phone: this.info.mobile_phone,
					email: this.info.email,
					header_url: this.info.logo_url,
					bus_id: this._id
				}, null, true);
				// as_user.addAddress()
				this.user_id = as_user._id;
				this.save();
			} else {
				as_user = UserCon.get(user_id);
			}
			return as_user;
		},
		//或者在本店铺注册的用户信息
		getRegisterUser: function() {
			var user_list = db.find_list(config.dbname.user, {
				info: {
					register_bus_id: this._id
				}
			});
			user_list = user_list.map(function(user_info) {
				return UserCon.getInstance(user_info)
			});
			this.body = ResponObj("json", user_list);
		}
	};
	module.exports = skill.multiInherits(
		require("./skill.goods"),
		require("./skill.tag"),
		require("./skill.classify"),
		require("./skill.coupon"),
		require("./skill.ticket_factory"),
		require("./skill.card_factory"),
		require("./skill.goods_args_map"),
		require("./skill.ach"),
		require("./skill.vips"),
		require("./skill.register_user"),
		require("./skill.extend.ach"),
		require("./skill.extend.goods"),
		require("./skill.extend.invite"),
		require("./skill.extend.theme"),
		require("./skill.extend.bina"),
		require("./skill.extend.goods_num"),
		require("./skill.extend.MA"),
		require("./skill.extend.purchase"),
		require("./skill.assshop"),
		require("./skill.sendmsg"),
		require("./skill.extend.space"),
		require("./skill.extend.employees"),
		require("./skill.statistical"),
		require("./skill.guide"),
		require("./skill.bus_user_bind"),
		require("./skill.bus_user"),
		require("./skill.express"),
		require("./skill.extend.lottery")
	);

	var db = require("../db/index");
	var DomainCon = require("../domain/_con");
	var GoodsCon = require("../goods/_con");
	var UserCon = require("../../core/user/_con");
	var BusCon = require("../../core/bus/_con");
	var AchCon = require("../ach/_con");
	var ClassifyCon = require("../bus.classify/_con");
	var TagCon = require("../bus.tag/_con");
	var LeagueCon = require("../league/_con");
	var BuffCon = require("../buff/_con");
	var BusUserBindCon = require("../bus_user_bind/_con");
	var BusGuideCon = require("../bus.guide/_con");
	var CommentCon = require("../comment/_con");
	var config = require("../_include/config");
	var data_cut = require("../_include/data_cut");
	var helper = require("../_include/helper");
	var md5 = require("../_include/md5");
	var $Object = require("../_include/$.Object");
	var $Array = require("../_include/$.Array");
	var tld = require('tldjs');
	var fs = require("fs");
	var Fiber = require('fibers');
	var LBS = require("../_include/baiduLBS");
	var midEvent = require("../../middleware/index");
}());